Previous Next Contents Generated Index Doc Set



CHAPTER 12 : Configuration


Integration with an IDE

To integrate Visaj with Java Workshop 2.0, use the Java Workshop integration package available from the same source as your Visaj1. Once integrated, a Visaj icon appears on the Java Workshop toolbar allowing you to create new Visaj Class Editor save files (".vcl") or edit existing ones. When a Visaj Class Editor save file is added to a Java Workshop project, Java Workshop will automatically cause the appropriate Java source code files to be generated when you build the project.


Note - If you have any problems with the Java Workshop integration, you may wish to check whether any extra information is listed in the README file supplied with the integration package.

To use other IDEs, refer to the documentation supplied by the IDE vendor or simply add the generated ".java" source code files to the project. For details of the latest integrations with IDEs, visit the following website:

http://www.ist.co.uk


Palette File

If you wish to add components for use in Visaj, you can do so by defining a palette file or by loading a JAR file. Loading JARs is described in the Loading JAR Files section on page 60. The palette file is a text file containing the list of components to add, as full package names. You will also need to make sure that your CLASSPATH environment variable2 points to the location of the new components. Both of these are described below.


Note - Visaj is supplied with several pre-defined palette files. These can be found in the palettes directory beneath your Visaj install directory.

This is an example palette file:

palette {
	title = "AWT"
	jar = "/components/jars/klg/jcchart200.jar"
	group {
		title = "KLG Chart"
		item {
			title = "JCChartComponent"
			class = "jclass.chart.JCChartComponent"
			help = "Create a JCChartComponent"
		}
	}	
	jar = "/components/jars/jscape/java1/jars/Animator.jar"
	group {
		title = "JScape"
		item {
			title = "Animator"
			class = "COM.jscape.widgets.Animator"
		}
		item {
			title = "BaseTabbedPanel"
			class = "COM.jscape.widgets.BaseTabbedPanel"
		}
	}
	group {
		title = "TeaSet"
		item {
			title = "AnimatedButton"
			class = "tea.set.AnimatedButton"
		}
		item {
			title = "Animator"
			class = "tea.set.Animator"
		}
		item {
			title = "ArrowButton"
			class = "tea.set.ArrowButton"
		}
	}
}
group {
		title = "KL"
		item {
			title = "DemoFrame"
			class = "jclass.chart.demos.DemoFrame"
		}
		item {
			title = "MyShape"
			class = "jclass.chart.demos.basic.MyShape"
		}
}

There are four levels in the palette file:

  1. The name of the palette. For the current release, this will always be "AWT", as shown above.
  2. The name and location of the jar file to load for some or all of the components in the palette. This is optional. If no jar file is specified, Visaj checks your CLASSPATH.
  3. The "group". In the above example, there are three groups: TeaSet, KL and JScape. All items inside the group will appear together and labelled appropriately on the component palette.
  4. The "item". This level identifies the individual component.

There are two further fields at the "item" level relating to components: "icon" and "help". "icon" is the name of the icon to display on the palette (a ".gif" suffix is assumed) and "help" is the text to display in the status line. These fields can be seen in the following extract from the built-in palette file for Visaj:

		item {
			title = "Panel"
			class = "java.awt.Panel"
			icon = "Panel"
			help = "Create a Panel"
		}
		item {
			title = "ScrollPane"
			class = "java.awt.ScrollPane"
			icon = "ScrollPane"
			help = "Create a ScrollPane"
		}

Using VISAJOPTS

When you have created your palette file, you need to tell Visaj where it is. There are three ways of doing this:

Here is an example of how the VISAJOPTS environment variable is used:

setenv VISAJOPTS -Dvj.AWTPalette.file=/u/me/paletteFile

where /u/me/paletteFile is the full pathname of your palette file. The syntax of the line will depend on the shell or operating system you are using.

Microsoft Windows NT

If you are using Microsoft Windows NT, make sure that you use the backslash character (`\') instead of the forward slash character (`/') when specifying a pathname, as in the example above.

Microsoft Windows 95

It is not possible to use the VISAJOPTS environment variable on Microsoft Windows 95. If you wish to set up Visaj so that a particular palette is always loaded on that system, you will need to create a batch file containing a command line configured as described in the following section.

Using the Command Line

You can tell Visaj that you wish to use merge your own palette file into the default palette by using the following system property either from the command line or in a startup script. Here is an example:

visaj -Dvj.AWTPalette.file=/u/me/paletteFile

This merges the palette file /u/me/paletteFile into the palette you have selected for starting Visaj - AWT or Swing. Use vj.CommonPalette.file to merge a palette file into both the AWT and Swing palettes.

CLASSPATH - Locating Classes

The CLASSPATH environment variable3 must contain the full pathnames of the package containing the class files of any new components you wish to have on your component palette. This may be a ".jar", a ".zip" file or the full pathname of a directory containing the class files. By default, Visaj automatically loads the Java AWT components and the IST Diamonds.


Pre-defined Palette Files

Supplied with Visaj are some pre-defined palette files which load various components from different vendors. These reside in the palettes directory which can be found in the Visaj install directory. The README file in the same directory lists which components are loaded by each of the palette files supplied. To use these palette files you will need to set your CLASSPATH environment variable to point to the class files (or jar file) supplied by the component vendor.


Merging Palette Files

You may merge a palette file into your existing Class Editor window by selecting "Merge palette..." from the Palette menu. Specify the name of the palette file where prompted. You must make sure that your CLASSPATH environment variable contains the locations of the class or jar files for the classes in the new palette file. See also the Loading JAR Files section on page 60 for another way of adding objects to your palette.


Use Swing Palette

Type

visaj -swing

to have the Swing palette supplied with Visaj loaded at start-up. You must make sure that the Swing jar file is in your CLASSPATH before starting Visaj. See the Loading Swing Components section on page 90 for more information.


Visaj Options

The following sections detail the Visaj options (or system properties) which alter some aspect of Visaj's appearance or behavior. The sections are grouped according to the type of change effected by the option.

These options are passed as arguments to Visaj using "-D" and then the property (with no spaces), followed by any arguments which may be required. This is shown in the following example:

visaj -Dvj.menuFont=Helvetica-italic-

Some of the options do require an argument, such as a filename or a value of true or false. Others are simply switches and cause a change in behavior just by being passed to Visaj.

If you pass in a badly formatted string or a type of property which does not exist it is ignored. No error message is displayed.

Fonts

The following system properties allow you to change the fonts Visaj uses:

  1. vj.menuFont
  2. vj.windowFont

vj.menuFont allows you to specify the font that should be used for menus. vj.windowFont lets you change the font used elsewhere in the windows. On some platforms, the default fonts are not very suitable.

The font should be specified in one of the following ways:

  1. <fontname>-<style>-<pointsize>
  2. <fontname>--<pointsize>
  3. <fontname>-<style>-
  4. <fontname>

Note - The trailing hyphen (-) in number 4 is required.

Palettes

Use vj.AWTPalette.file to specify a palette file to merge into either the AWT or Swing palette - whichever you have selected to appear on startup. Use vj.CommonPalette.file to specify a palette file to merge into both the AWT and Swing palettes.

Design Time Flag

To set the design time flag for beans, use vj.beanDesignTime, setting this to "true", like this:

visaj -Dvj.beanDesignTime=true

This will cause all beans to operate in design mode.

Temporary Directory

By default, Visaj uses /tmp as the directory in which to compile event bindings so that they can be used in the dynamic display. If you wish to change this, use vj.tmpDir, setting it to your preferred directory. For example:

visaj -Dvj.tmpDir=/u/me

Current Directory for Code Generation

By default, Visaj shows the current working directory when the Generate dialog is displayed. You can override this by using the vj.cwd property.

Swing Conversion

The option vj.convertPackages=true allows you to convert swing package names from the older form of com.sun.java.swing.<class> to the newer javax.swing.<class>. Since the default behavior is the same as passing "false" using this option, you do not

Plug In File

The option vj.pluginFile tells Visaj where to find a plug-in. By default, Visaj looks for plug-ins in the PlugIns directory in the Visaj installation directory.

Migration from Java WorkShop

If you wish to use Visaj with your .gui files created with Java WorkShop, start Visaj with the option vj.JWS=true. An extra menu is displayed in Visaj's menubar, labelled "Java WorkShop". This menu contains the commands required to convert a .gui file.

Remember that the shadow runtime needs to be in the classpath.

Scope of Beans

The vj.variablesDefaultToInstanceVars option controls whether beans added to a design are local variables or instance variables. The default value for this option is true, which means that beans are normally added as instance variables.

Use System Colors

The option DTColors causes Visaj to use the system colors.

Switch off JIT

Passing the java.compiler=none option via Visaj switches off the JIT compiler. This produces an error message which can be safely ignored.



1 The release and installation notes supplied with Visaj provide details.

2 Environment variables are available on UNIX and Microsoft Windows. Other platforms, such as the Apple macintosh, use their own method of setting a CLASSPATH. Please refer to the relevant Java documentation for more information.

3 Environment variables are available on UNIX and Microsoft Windows. Other platforms, such as the Apple macintosh, use their own method of setting a CLASSPATH. Please refer to the relevant Java documentation for more information.


Previous Next Contents Generated Index Doc Set

Copyright © 1998, 1999 Pacific Imperial Inc., TakeFive Software Inc. All Rights Reserved.